home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
HAM_RAD
/
PROPAGAT
/
1004A.ZIP
/
METEOR.BAS
< prev
next >
Wrap
BASIC Source File
|
1987-05-12
|
20KB
|
453 lines
10 CLS: KEY OFF
20 PRINT:PRINT " ***************** METEOR *******************": PRINT
30 PRINT " METEOR SCATTER PREDICTION PROGRAM
40 PRINT " MICHAEL R. OWEN, W9IP
50 PRINT " 21 MAPLE ST.
60 PRINT " CANTON, NY 13617
70 PRINT
80 REM *** THIS PROGRAM CALCULATES THE PEAK TIME FOR MAJOR METEOR
90 REM *** SHOWERS. IT ALSO PROVIDES INFORMATION CONCERNING THE
100 REM *** OPTIMUM TIMES FOR PARTICULAR PATHS, IN GRAPHIC AND TABLE
110 REM *** FORM. THE PROGRAM IS WRITTEN FOR THE IBM-PC AND ALL
120 REM *** COMPATIBLE COMPUTERS (MS-DOS OR PC-DOS, PLUS BASICA).
130 REM ***********************************************************
140 REM * PLEASE NOTE: YOU MUST ENTER YOUR OWN LATUTUDE AND *
150 REM * LONGITUDE ON LINES 190 AND 200 BELOW. REMEMBER THAT *
160 REM * SOUTH LATITUDES AND WEST LONGITUDES ARE NEGATIVE. *
170 REM * YOU WILL ALSO WANT TO CHECK THE DEFAULT YEAR (LINE 3720)*
180 REM ***********************************************************
190 MYLATD = 52.3: REM *** SOUTH LATITUDES ARE NEGATIVE!
200 MYLOND =- 3!:REM *** WEST LONGITUDES ARE NEGATIVE!
210 REM *** PC BASIC DOESN'T HAVE ARCCOS OR ARCSIN, SO DEFINE FUNCTIONS HERE
220 DEF FNACOS(X)=1.570796-ATN(X/SQR(1.000001-X*X))
230 DEF FNARSIN(X)= ATN(X/SQR(1!-X*X))
240 DIM LDATE(400),LTIME(400),LELEV(400),LAZIM(400)
250 REM *************************************
260 REM INITIALIZING PROGRAM: SETTING OPTIONS
270 REM *************************************
280 LENG=0: INCR=0: COUNTR=0: ENDER=1: BEST=0: HEADER=0: OPTDIR=0: BESEL=90
290 GOSUB 4400
300 IF COUNTR=1 THEN CLS
310 PRINT: PRINT: PRINT
320 PRINT " OPTIONS:"
330 PRINT
340 PRINT " 1) PEAK TIME PREDICTION"
350 PRINT " 2) (1) PLUS GRAPH OF AZ/EL OF RADIANT FOR A PARTICULAR PATH"
360 PRINT " 3) LISTING OF GOOD TIMES FOR ALL PATHS"
370 PRINT " 4) BEST PATH FOR A PARTICULAR TIME"
380 PRINT
390 PRINT
400 INPUT "WHAT IS YOUR CHOICE (1-4)";WHICH
410 IF WHICH <1 OR WHICH>5 THEN 400
420 IF WHICH <>2 THEN 550
430 CLS: PRINT "WHICH GENERAL DIRECTION?"
440 PRINT: PRINT
450 PRINT "1) NORTH": PRINT "2) NORTHEAST": PRINT "3) EAST"
460 PRINT "4) SOUTHEAST": PRINT "5) SOUTH": PRINT "6) SOUTHWEST"
470 PRINT "7) WEST": PRINT "8) NORTHWEST"
480 PRINT: PRINT "9) SPECIFIC LAT,LON (SOUTH LAT AND WEST LON ARE NEGATIVE)"
490 PRINT: PRINT "10) SPECIFIC BEARING FROM YOUR QTH (0-360)"
500 PRINT: PRINT: PRINT: INPUT "CHOOSE DIRECTION BY NUMBER (1-10)";DIRECTION
510 IF DIRECTION <1 OR DIRECTION >10 THEN 500
520 IF WHICH <>2 THEN 550
530 IF DIRECTION=9 THEN INPUT "OTHER STATION'S LAT,LONG ";HISLATD,HISLOND: GOSUB 3270
540 IF DIRECTION=10 THEN INPUT "BEARING (DEGREES)";LOOK
550 CLS: PRINT: PRINT: PRINT " METEOR SHOWER" TAB(27);"DATE"
560 PRINT
570 PRINT " 1) QUADRANTIDS ";TAB(25);" 4 JANUARY"
580 PRINT " 2) LYRIDS ";TAB(25);"22 APRIL"
590 PRINT " 3) ETA AQUARIDS";TAB(25);" 4 MAY"
600 PRINT " 4) ARIETIDS ";TAB(25);" 7 JUNE"
610 PRINT " 5) PERSEIDS ";TAB(25);"12 AUGUST"
620 PRINT " 6) DRACONIDS ";TAB(25);"10 OCTOBER"
630 PRINT " 7) ORIONIDS ";TAB(25);"20 OCTOBER"
640 PRINT " 8) LEONIDS ";TAB(25);"17 NOVEMBER"
650 PRINT " 9) GEMINIDS ";TAB(25);"13 DECEMBER"
660 PRINT: PRINT: PRINT
670 INPUT "FOR WHICH SHOWER DO YOU WANT INFORMATION (1-9)";SHOWER
680 IF SHOWER <1 OR SHOWER >9 THEN 670
690 GOSUB 3670: IF WHICH=1 THEN 2400
700 IF WHICH=4 THEN PRINT:PRINT: INPUT "WHAT TIME (OPT. 4)";STARTTIME: GOTO 780
710 PRINT: PRINT "FOR THIS RUN, DEFAULT VALUES IN [ ]"
720 PRINT: INPUT "HOW LONG? (HOURS) [24] "; LENG
730 IF LENG=0 THEN LENG=24: REM *** DEFAULT ON EMPTY RETURN
740 LENG=LENG*100
750 INPUT "WHAT INCREMENT (MINUTES) [60] "; INCR
760 IF INCR=0 THEN INCR=60: REM *** DEFAULT ON EMPTY RETURN
770 IF INCR>60 THEN INCR=CINT((INCR/60)*100)
780 PRINT "DO YOU WANT INFORMATION FOR THE PEAK DAY ("M"/"DAY")? [Y] ":INPUT CENT$
790 IF CENT$<>"N" THEN CENT$="Y": REM *** DEFAULT ON EMPTY RETURN
800 IF CENT$="Y" THEN 820
810 INPUT "WHAT DATE DO YOU WANT (MONTH, DAY)"; M,DAY
820 IF WHICH=4 THEN 870
830 INPUT "START TIME, UTC (EXAMPLE: 0000) [0000] "; STARTTIME
840 REM *** STARTTIME=0 IS AUTOMATIC
850 REM *** THIS LOOP "LOOKS" AROUND THE COMPASS AT 45 DEGREE INCREMENTS
860 IF WHICH=3 THEN FOR DIRECTION = 1 TO 8
870 ROUNDS=0
880 TIME=STARTTIME
890 TIMECOUNT=TIME
900 FINISH=TIMECOUNT+LENG+100
910 GOSUB 2490: T=S*15*R1
920 IF COUNTR>0 THEN 1070
930 REM *** INPUT RIGHT ASCENSION DATA: RAHOUR, RAMIN IN DATA STATEMENT.
940 REM *** A$ IS HOURS, A2 IS MIN, A3 IS SEC.
950 REM *** CHANGE THESE OR WRITE AN INPUT STATEMENT IF YOU WANT TO
960 REM *** EVALUATE OTHER METEOR SHOWERS (OR OTHER CELESTIAL OBJECTS)
970 A$= STR$(RAHOUR): A2=RAMIN: A3=0
980 GOSUB 2420: R=A*15*R1
990 REM *** INPUT DECLINATION, SAME COMMENTS AS ABOVE
1000 A$=STR$(DEC): A2=0: A3=0
1010 GOSUB 2420: DEG=A*R1
1020 IF WHICH<>4 THEN 1070
1030 PRINT: PRINT: PRINT "PLEASE WAIT"
1040 FOR BESTDIR=0 TO 355 STEP 5
1050 ANGLE=BESTDIR
1060 GOTO 1210
1070 IF WHICH=2 AND COUNTR=1 THEN 1240
1080 REM *** THIS SECTION CHOOSES PATHS IN 45 DEGREE STEPS
1090 IF DIRECTION = 9 THEN GOSUB 3270: GOSUB 2810: GOTO 1270
1100 IF DIRECTION = 1 THEN ANGLE=0:WAY$="N"
1110 IF DIRECTION = 2 THEN ANGLE=45: WAY$="NE"
1120 IF DIRECTION = 3 THEN ANGLE=90: WAY$="E"
1130 IF DIRECTION = 4 THEN ANGLE=135: WAY$="SE"
1140 IF DIRECTION = 5 THEN ANGLE=180: WAY$="S"
1150 IF DIRECTION = 6 THEN ANGLE=225: WAY$="SW"
1160 IF DIRECTION = 7 THEN ANGLE=270: WAY$="W"
1170 IF DIRECTION = 8 THEN ANGLE=315: WAY$="NW"
1180 IF DIRECTION = 10 THEN ANGLE=LOOK
1190 REM *** "RIGHT" AND "RIGHT2" ARE THE AZIMUTH OF POINTS AT
1200 REM *** 90 DEGREE ANGLES TO THE PATH OF INTEREST.
1210 RIGHT=(ANGLE+90) MOD 360: RIGHT2=(ANGLE+270) MOD 360
1220 IF WHICH=3 OR COUNTR=0 THEN IF ROUNDS=0 THEN GOSUB 4270
1230 IF ROUNDS=0 THEN MIDLATD=CIRLATD: MIDLOND=CIRLOND
1240 IF WHICH=2 AND COUNTR=0 THEN GOSUB 2810: REM SET UP GRAPH
1250 REM *** MIDLATD AND MIDLOND ARE THE SPOTS HALFWAY ALONG THE
1260 REM *** PATH OF INTEREST (THIS IS WHERE THE METEORS NEED TO BE).
1270 B=MIDLATD: L=MIDLOND
1280 B=B*R1: L=L*R1
1290 REM *** THIS SECTION DETERMINES THE AZ AND EL OF THE RADIANT BASED
1300 REM *** ON ITS R.A. AND DEC. AT PATH MIDPOINT.
1310 T5=T-R+L: REM LHA
1320 COSDEG=COS(DEG): SINDEG=SIN(DEG)
1330 SINB=SIN(B)
1340 S1=SINB*SINDEG
1350 COSINB=COS(B)
1360 S1=S1+COSINB*COSDEG*COS(T5)
1370 C1=1-S1*S1
1380 IF C1>0 THEN C1=SQR(C1)
1390 IF C1<=0 THEN 1410
1400 H=ATN(S1/C1): GOTO 1420
1410 H=SGN(S1)*P/2
1420 C2=(COSINB*SINDEG)-SINB*COSDEG*COS(T5)
1430 S2=-COSDEG*SIN(T5)
1440 IF C2=0 THEN A=SGN(S2)*P/2:GOTO 1470
1450 A=ATN(S2/C2)
1460 IF C2<0 THEN A=A+P
1470 IF A <0 THEN A=A+2*P
1480 ELEV=H/R1: AZIM=A/R1
1490 REM *** LOAD ARRAY WITH AZ, EL DATA
1500 IF WHICH<>2 THEN 1550
1510 LAZIM(ENDER)=AZIM
1520 LELEV(ENDER)=ELEV
1530 LDATE(ENDER)=DAY
1540 LTIME(ENDER)=TIME
1550 IF ELEV<0 THEN 1840
1560 QUAL=0: BEST=0
1570 REM *** ROUTINE TO INDICATE THE TIMES WHEN THE RADIANT IS
1580 REM *** WITHIN +/- 15 DEG OF PERPENDICULAR TO THE DESIRED
1590 REM *** PATH (GOOD) AND WHEN IT IS ALSO WITHIN +/- 15 DEG OF
1600 REM *** 45 DEG ELEVATION AT PATH MIDPOINT (BEST).
1605 IF ELEV<20 AND WHICH=4 THEN 1660
1610 IF ELEV<20 THEN 1740
1620 IF (AZIM>(RIGHT-15) AND AZIM<(RIGHT+15)) OR (AZIM>(RIGHT2-15) AND AZIM<(RIGHT2+15)) THEN QUAL=1
1630 IF QUAL=1 AND ELEV>30 AND ELEV<60 THEN BEST=1
1640 IF WHICH<>4 THEN 1740
1650 IF BEST=1 AND ABS(45-ELEV)<ABS(45-BESTEL) THEN OPTDIR=ANGLE: BESTEL=ELEV
1660 NEXT BESTDIR
1670 BEEP: COLOR 15
1680 IF OPTDIR>1 THEN 1720
1690 PRINT: PRINT "NO GOOD DIRECTIONS AT";TIME;"UTC."
1700 PRINT: PRINT "RUN OPTION 2 TO CHECK IF RADIANT IS ABOVE HORIZON"
1710 PRINT: PRINT: COLOR 7: GOTO 2200
1720 PRINT:PRINT "BEST DIRECTION AT";TIME; "UTC ="OPTDIR;"DEGREES"
1730 COLOR 7: GOTO 2200
1740 IF WHICH=3 THEN 1790
1750 IF QUAL=1 AND BEST=0 THEN LOCATE 23,10:PRINT "GOOD TIME:" TIME
1760 COLOR 15
1770 IF BEST=1 AND ABS(45-ELEV)<ABS(45-BESEL) THEN BESEL=ELEV:BESTIME=TIME
1780 COLOR 7
1790 IF WHICH=3 AND HEADER=0 THEN GOSUB 2990
1800 IF QUAL=1 AND BEST=0 AND WHICH=3 THEN PRINT TIME,WAY$
1810 COLOR 15
1820 IF BEST=1 AND WHICH=3 THEN PRINT TAB(30) TIME,WAY$
1830 COLOR 7
1840 IF WHICH <>2 THEN 2020
1850 IF COUNTR<>0 THEN 1920
1860 LOCATE 21,5
1870 PRINT"NORTH SOUTH NORTH"
1880 REM *** PLOT THE APPROXIMATE AZ, EL DATA FOR
1890 REM *** THE RADIANT AS A FUNCTION OF TIME.
1900 REM *** THE 'LOCATE' ARGUMENT IS DERIVED FROM
1910 REM *** INTEGER VALUES OF AZ AND EL.
1920 J=CINT(AZIM/6)+5
1930 I=CINT(20-(ELEV/5))
1940 IF I<=0 THEN I=1
1950 IF I>20 THEN I=20
1960 PNT$=STR$(INT(TIME/100))
1970 IF I=20 THEN 2020
1980 REM *** HIGHLIGHT BEST TIMES ON THE GRAPH
1990 IF BEST=1 THEN COLOR 15
2000 LOCATE I,J: PRINT "*";PNT$
2010 COLOR 7
2020 TIMECOUNT=TIMECOUNT+INCR
2030 IF TIMECOUNT-(INT(TIMECOUNT/100)*100)=>60 THEN TIMECOUNT=TIMECOUNT+40
2040 TIME=TIME+INCR
2050 COUNTR=1: ENDER=ENDER+1
2060 ROUNDS=1
2070 IF TIMECOUNT<FINISH THEN 910
2080 IF WHICH=2 AND DIRECTION < 9 THEN LOCATE 23,55: PRINT WAY$;" PATH"
2090 IF WHICH=2 AND DIRECTION>8 THEN LOCATE 23,55:PRINT "BEARING:";CINT(ANGLE);"DEG."
2100 IF WHICH=3 THEN NEXT DIRECTION: BEEP: GOTO 2200
2110 IF BESTIME=0 THEN 2130
2120 LOCATE 23,30: PRINT "BEST TIME:"BESTIME
2130 LOCATE 24,10
2140 IF WHICH=2 THEN INPUT "DO YOU WANT LISTED OUTPUT"; LISTED$
2150 IF LISTED$="Y" THEN PRINT: PRINT " SHOWER: ";SHOWER$: PRINT
2160 IF LISTED$="Y" THEN PRINT"DAY","TIME, UTC","AZIMUTH","ELEVATION" ELSE 2200
2170 FOR K=1 TO ENDER-1
2180 PRINT LDATE(K),LTIME(K),LAZIM(K),LELEV(K)
2190 NEXT K
2200 INPUT "DO YOU WANT ANOTHER RUN (Y/N)"; AGAIN$
2210 IF AGAIN$="Y" THEN COUNTR=0: ENDER=0: PRINTED=0: BESTEL=999
2220 IF AGAIN$="Y" THEN 280 ELSE 2400
2230 REM **************************************************
2240 REM DATA FOR MAJOR (AND SOME MINOR) METEOR SHOWERS
2250 REM FROM "ASTRONOMICAL CALENDAR 1985" BY GUY OTTWELL,
2260 REM PHYSICS DEPT, FURMAN UNIV.,GREENVILLE, SC.
2270 REM **************************************************
2280 REM *** DATA FORMAT: NAME, E.L., MONTH, DAY, TIME ABOVE QUARTER MAX,
2290 REM *** VELOCITY (KM/SEC), APPROX. RATE, RADIANT R.A. HOURS, R.A. MINUTES,
2300 REM *** DECLINATION, CEPLECHA'S CLASS, HEIGHT OF IONIZATION (KM)
2310 DATA QUADRANTIDS,282.80,1,4,14 HOURS,41.5,110,15,28,50,B,100
2320 DATA LYRIDS,31.4,4,21,2.3 DAYS,47,VARIABLE,18,8,32,BC,105
2330 DATA ETA AQUARIDS,44,5,4,3 DAYS,67,21,22,20,-1,C2,115
2340 DATA ARIETIDS,75.0,6,5,RICH BUT SMALL,37,60,2,56,23,UNKNOWN,100
2350 DATA PERSEIDS,139.3,8,11,4.6 DAYS,60,68,3,4,58,C2,110
2360 DATA DRACONIDS, 196.3,10,10,1.2 HOURS,21,42,17,28,54,C1,97
2370 DATA ORIONIDS, 207,10,20,2 DAYS,67,35,6,20,15,C2,115
2380 DATA LEONIDS, 234.7,11,16,4 DAYS,71,40,10,8,22,C2,150
2390 DATA GEMINIDS, 261.9,12,13,2.6 DAYS,35,58,7,28,32,B,95
2400 KEY ON: END
2410 REM *********************************
2420 REM SEXAGESIMAL TO DECIMAL CONVERSION
2430 REM *********************************
2440 S=1: A1=ABS(VAL(A$))
2450 IF LEFT$(A$,1)="-" THEN S=-1
2460 A=S*(A1+A2/60+A3/3600)
2470 RETURN
2480 REM ***************************************
2490 REM GREENWICH MEAN SIDERIAL TIME CONVERSION
2500 REM ***************************************
2510 HOUR=INT(TIME/100)
2520 MIN=TIME-(HOUR*100)
2530 IF MIN=>60 THEN TIME=TIME+40: GOTO 2510
2540 IF TIME>2400 THEN TIME=TIME-2400: DAY=DAY+1
2550 HOUR=HOUR/24: MIN=MIN/1440
2560 D=DAY+HOUR+MIN
2570 D1=INT(D): F=D-D1-.5
2580 J=-INT(7*(INT((M+9)/12)+Y)/4)
2590 S=SGN(M-9): A=ABS(M-9)
2600 J1=INT(Y+S*INT(A/7))
2610 J1=-INT((INT(J1/100)+1)*3/4)
2620 J=J+INT(275*M/9)+D1+J1
2630 J=J+1721027!+2+367*Y
2640 IF F>=0 THEN 2670
2650 F=F+1: J=J-1
2660 D=J-2451545!
2670 T=D/36525!: T1=INT(T)
2680 J0=T1*36525!+2451545!
2690 T2=(J-J0+.5)/36525!
2700 S=24110.54841#+184.812866#*T1
2710 S=S+8640184.812866#*T2
2720 S=S+.093104*T*T
2730 S=S-.0000062*T*T*T
2740 S=S/86400!: S=S-INT(S)
2750 S=24*(S+(F-.5)*1.002737909#)
2760 IF S<0 THEN S=S+24
2770 IF S>24 THEN S=S-24
2780 RETURN
2790 REM *******************************
2800 REM ROUTINE TO INITIALIZE THE GRAPH
2810 REM *******************************
2820 CLS
2830 LOCATE 1,22: PRINT "SHOWER: ";SHOWER$; "(";M;"/"DAY;"/"Y;")"
2840 LOCATE 2,13
2850 PRINT "AZ, EL OF RADIANT AT PATH MIDPOINT: LAT";CINT(MIDLATD);"LON ";CINT(MIDLOND)
2860 FOR I=2 TO 20
2870 LOCATE I,3:PRINT (90-(I*5))+10
2880 NEXT I
2890 LOCATE 5,1: PRINT "E": LOCATE 6,1: PRINT "L": LOCATE 7,1: PRINT "E"
2900 LOCATE 8,1: PRINT "V": LOCATE 9,1: PRINT "A": LOCATE 10,1: PRINT "T"
2910 LOCATE 11,1: PRINT "I": LOCATE 12,1: PRINT "O": LOCATE 13,1: PRINT "N"
2920 REM SET BOTTOM AXIS
2930 FOR J=5 TO 65 STEP 5
2940 LOCATE 20,J-1:PRINT (J-5)*6
2950 NEXT J
2960 LOCATE 11,7: PRINT "-------------------------------------------------------------"
2970 RETURN
2980 REM *************************
2990 REM ROUTINE TO TITLE OPTION 3
3000 REM A************************
3010 CLS: PRINT "SHOWER: ";SHOWER$ " DATE: "M;"/"DAY;"/"Y; " PEAK AT ";GMT;" UTC": PRINT:
3020 PRINT " GOOD TIMES"
3030 COLOR 15
3040 LOCATE 3,33: PRINT "BEST TIMES"
3050 COLOR 7
3060 HEADER=1
3070 RETURN
3080 REM *********************************************
3090 REM ROUTINE TO CALCULATE ECLIPTIC LONGITUDE FROM
3100 REM 'THE ASTRONOMICAL ALMANAC FOR 1985' PAGE C24.
3110 REM *********************************************
3120 JC#=CDBL(J)
3130 FC#=CDBL(F)
3140 JD#=JC#+FC#
3150 REM *** JD# IS DOUBLE-PRECISION JULIAN DAY
3160 N#=JD#-2451545#
3170 LONSUN#=280.46+(.9856474*N#)
3180 G#=357.528+(.9856003*N#)
3190 IF LONSUN#<0 THEN LONSUN#=LONSUN#+360!
3200 IF G#<0 THEN G#=G#+360!
3210 IF LONSUN#<0 THEN 3190
3220 IF G#<0 THEN 3200
3230 RCON#=180!/3.141592654#
3240 LONSUNT#=LONSUN#+(1.915*SIN(G#/RCON#))+(.02*SIN(2*(G#/RCON#)))
3250 RETURN
3260 REM *********************************************
3270 REM ROUTINE TO DETERMINE THE BEARING AND DISTANCE
3280 REM BETWEEN ANY TWO POINTS ON THE EARTH.
3290 REM *********************************************
3300 IF DIRECTION<>9 THEN HISLATD=CIRLATD: HISLOND=CIRLOND
3310 DIFLOND=MYLOND-HISLOND
3320 MIDLATD=MYLATD-((MYLATD-HISLATD)/2)
3330 REM *** DIFFERENCE IN LONGITUDES MUST FALL BETWEEN -180 AND +180
3340 IF DIFLOND<-180 THEN DIFLOND=DIFLOND+360
3350 IF DIFLOND>180 THEN DIFLOND=DIFLOND-360
3360 REM *** DEGREES TO RADIANS CONVERSION
3370 HISLAT=HISLATD*R1: HISLON=HISLOND*R1
3380 DIFLON=DIFLOND*R1
3390 REM *** DISTANCE CALCULATION
3400 COSB=(SMYLAT*SIN(HISLAT))+(CMYLAT*COS(HISLAT)*COS(DIFLON))
3410 BETA=FNACOS(COSB)
3420 BETA2=BETA/R1
3430 REM *** '69.05' IS THE CONVERSION FACTOR FOR STATUTE MILES.
3440 REM *** FOR KILOMETERS, USE 111.2, AND FOR NAUTICAL MILES 60.0.
3450 DIST=BETA2*69.05
3460 REM *** BEARING CALCULATION
3470 COSA=(SIN(HISLAT)-(SMYLAT*COSB))/(CMYLAT*SIN(BETA))
3480 REM *** ROUNDING ERRORS SOMETIMES LET COSA>1 OR <-1 (ERROR)
3490 IF COSA>1! THEN COSA=1!
3500 IF COSA<-1! THEN COSA=-1!
3510 AZ=FNACOS(COSA)
3520 ANGLE=AZ/R1
3530 REM *** HAFLON IS THE LON OF A POINT BETWEEN HERE AND THERE
3540 HAFLON=FNACOS((COS(BETA/2)-(SMYLAT*SIN(MIDLATD*R1)))/(CMYLAT*COS(MIDLATD*R1)))
3550 IF DIFLOND>0 THEN ANGLE=360!-ANGLE
3560 IF DIRECTION<>9 OR PRINTED=1 OR WHICH<>2 THEN 3600
3570 PRINT: PRINT "DISTANCE: ";DIST;" MILES," BETA2*111.2;" KM";" BEARING:";ANGLE;" DEGREES"
3580 INPUT "PRESS 'ENTER' TO CONTINUE" ;PAUSE$
3590 PRINTED=1
3600 IF ANGLE>180 THEN HAFLON=MYLON-HAFLON ELSE HAFLON=MYLON+HAFLON
3610 MIDLOND=HAFLON/R1
3620 RETURN
3630 REM ************************************************************
3640 REM ROUTINE TO READ DATA AND CALCULATE PEAK DATE/TIME MODIFIED
3650 REM AFTER PROGRAMS BY RUSS WICKER (W4WD) AND JOE REISERT (W1JR).
3660 REM ************************************************************
3670 FOR I=1 TO SHOWER
3680 READ SHOWER$,ELON,M,DAY,DURATION$,VELOCITY$,RATE$,RAHOUR,RAMIN,DEC,CLASS$,HEIGHT
3690 NEXT I
3700 RESTORE
3710 PRINT: PRINT: INPUT " WHAT YEAR [1986] "; Y
3720 IF Y=0 THEN Y=1986
3730 TIME=0
3740 GOSUB 2490
3750 GOSUB 3090
3760 IF LONSUNT#>ELON THEN 3810
3770 DAY=DAY+1
3780 GOSUB 2490
3790 GOSUB 3090
3800 GOTO 3760
3810 IF LONSUNT#<=ELON THEN 3860
3820 E2=LONSUNT#
3830 DAY=DAY-1
3840 GOSUB 2490
3850 GOSUB 3090
3860 T=24*((ELON-LONSUNT#)/(E2-LONSUNT#))
3870 H0=INT(T)
3880 M1=INT(60*(T-H0)+.5)
3890 GMT=100*H0+M1
3900 IF GMT<0 THEN DAY=DAY-1: GOTO 3740
3910 IF DAY<=31 THEN 3940
3920 DAY=DAY-31
3930 M=M+1
3940 CLS: PRINT: PRINT
3950 PRINT "THE ";SHOWER$;" METEOR SHOWER WILL PEAK ON";M;"/";DAY;"/";Y
3960 PRINT "AT";GMT;"UTC."
3970 IF WHICH>1 THEN 700
3980 PRINT: PRINT: INPUT "MORE INFO ON THIS SHOWER [Y] ";MOREINFO$
3990 IF MOREINFO$<>"N" THEN MOREINFO$="Y"
4000 IF MOREINFO$<>"Y" THEN 4190
4010 PRINT
4020 PRINT " SHOWER: ";SHOWER$
4030 PRINT: PRINT "DURATION ABOVE QUARTER MAX.: ";DURATION$
4040 PRINT "VELOCITY: ";VELOCITY$;" KM/SEC"
4050 PRINT "AVERAGE HEIGHT OF IONIZATION: "; HEIGHT;" KM"
4060 PRINT "METEORS PER HOUR (APPROX): " RATE$
4070 PRINT "E.L. USED FOR CALCULATION: ";ELON;" DEGREES (EPOCH 2000.0)"
4080 PRINT "R.A. OF RADIANT: ";RAHOUR;" HR ";RAMIN;" MIN"
4090 PRINT "DECLINATION:"; DEC "DEGREES"
4100 PRINT "CEPLECHA'S CLASS: ";CLASS$
4110 TIME=GMT: GOSUB 2490: GOSUB 3090: ROUNDLON=INT(LONSUNT#*1000)/1000
4120 PRINT: PRINT "E.L. AT"GMT"=";ROUNDLON
4130 TIME=0: GOSUB 2490: GOSUB 3090: ROUNDLON=INT(LONSUNT#*1000)/1000
4140 DEGLON=INT(LONSUNT#): MINLON=INT((LONSUNT#-DEGLON)*60)
4150 SECLON=(INT((((LONSUNT#-DEGLON)*60)-MINLON)*60)*100)/100
4160 REM *** NEXT LINE IS DISPLAYED SO YOU CAN CHECK THE CALCULATED
4170 REM *** E.L. AGAINST THE NAUTICAL ALMANAC.
4180 PRINT "E.L. AT 0000 =";ROUNDLON,"(=";DEGLON;"DEGREES";MINLON;"MINUTES";SECLON "SECONDS)"
4190 PRINT: INPUT "DO YOU WANT ANOTHER RUN (Y/N) [Y] ";ANOTHER$
4200 IF ANOTHER$<>"N" THEN ANOTHER$="Y"
4210 IF ANOTHER$="Y" THEN 300 ELSE 2400
4220 RETURN
4230 REM ****************************************************
4240 REM *** ROUTINE TO CALCULATE LAT, LON OF A 500-MI CIRCLE
4250 REM *** WHICH REPRESENTS THE 1000-MILE PATH MIDPOINT
4260 REM ****************************************************
4270 COSA2=COS(ANGLE*R1): REM *** ANGLE IS THE BEARING FROM YOUR QTH
4280 REM *** CIRLATD IS THE LATITUDE OF THE POINT
4290 CIRLAT=FNARSIN ((COSA2*CMYLAT*SINBETA2)+(SMYLAT*COSBETA2))
4300 CIRLATD=CIRLAT/R1
4310 REM *** CIRLOND IS THE LONGITUDE OF THE POINT
4320 CIRLON= (COSBETA2-(SMYLAT*SIN(CIRLAT)))/(CMYLAT*COS(CIRLAT))
4330 IF CIRLON>1 THEN CIRLON=1!
4340 IF CIRLON<-1 THEN CIRLON=-1!
4350 CIRLON=FNACOS(CIRLON)
4360 IF ANGLE>180 THEN CIRLON=MYLON-CIRLON ELSE CIRLON=MYLON+CIRLON
4370 CIRLOND=CIRLON/R1
4380 RETURN
4390 REM *********************************************
4400 REM *** ROUTINE TO INITIALIZE VARIABLES WHICH ARE
4410 REM *** USED OFTEN. THIS SPEEDS THINGS UP.
4420 REM *********************************************
4430 P=3.141593: R1=P/180!
4440 MYLON=MYLOND*R1: MYLAT=MYLATD*R1
4450 CMYLAT=COS(MYLAT): SMYLAT=SIN(MYLAT)
4460 REM *** CIRRANGE=500 IS THE DISTANCE TO PATH MIDPOINT; THIS
4470 REM *** REPRESENTS A 1000-MILE RANGE; CHANGE FOR ANOTHER DISTANCE.
4480 CIRRANGE=500:CIRBETA2=(CIRRANGE/69.05)*R1:REM FOR KM CHANGE 69.05 TO 111.2
4490 COSBETA2=COS(CIRBETA2): SINBETA2=SIN(CIRBETA2)
4500 RETURN
4510 END